USE [ERP]
GO

/****** Object:  Table [dbo].[EmployeeContracts]    Script Date: 11/16/2009 14:30:58 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[EmployeeContracts](
	[EmployeeID] [nvarchar](50) NOT NULL,
	[ContractID] [nvarchar](50) NOT NULL,
	[SigningDate] [datetime] NULL,
	[ExpirationDate] [datetime] NULL,
 CONSTRAINT [PK_EmployeeContracts] PRIMARY KEY CLUSTERED 
(
	[EmployeeID] ASC,
	[ContractID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[EmployeeContracts]  WITH CHECK ADD  CONSTRAINT [FK_EmployeeContracts_Contracts] FOREIGN KEY([ContractID])
REFERENCES [dbo].[Contracts] ([ID])
GO

ALTER TABLE [dbo].[EmployeeContracts] CHECK CONSTRAINT [FK_EmployeeContracts_Contracts]
GO

ALTER TABLE [dbo].[EmployeeContracts]  WITH CHECK ADD  CONSTRAINT [FK_EmployeeContracts_Employees] FOREIGN KEY([EmployeeID])
REFERENCES [dbo].[Employees] ([ID])
GO

ALTER TABLE [dbo].[EmployeeContracts] CHECK CONSTRAINT [FK_EmployeeContracts_Employees]
GO

